import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'
import Layout from '@/layout'

Vue.use(VueRouter)

const routes = [
  {
    path: '/redirect',
    component: Layout,
    children: [
      {
        path: '/redirect/:path(.*)',
        component: () => import("@/views/redirect.vue")
      }
    ]
  },
  {
    path: '/',
    component: Layout,
    redirect: 'index',
    meta: {
      auth: [0, 1],
      
    },
    children: [
      {
        path: 'index',
        component: () => import("@/views/HomeView.vue"),
        meta: {
          auth: [0, 1],
          
        },
      }
    ]
  },
  {
    path: '/classStudentManage',
    component: Layout,
    redirect: 'noRedirect',
    meta: {
      auth: [0, 1],
      title: "班级学员管理"
    },
    children: [
      {
        path: 'classManage',
        component: () => import("@/views/classStudentManager/classManage.vue"),
        meta: {
          auth: [0],
          title: "班级管理"
        }
      },
      {
        path: 'studentManage',
        component: () => import("@/views/classStudentManager/studentManage.vue"),
        meta: {
          auth: [1],
          title: "学员管理"
        }
      },
      {
        path: 'aiLabel',
        component: () => import("@/views/classStudentManager/aiLabel.vue"),
        meta: {
          auth: [0],
          title: "AI标注"
        }
      }
    ]
  },
  {
    path: '/systemInfoManage',
    component: Layout,
    redirect: 'noRedirect',
    meta: {
      auth: [0],
      title: "系统信息管理"
    },
    children: [
      {
        path: 'adptManage',
        component: () => import("@/views/systemInfoManager/adptManage.vue"),
        meta: {
          auth: [0],
          title: "部门管理"
        },
      },
      {
        path: 'empManage',
        component: () => import("@/views/systemInfoManager/empManage.vue"),
        meta: {
          auth: [0],
          title: "员工管理"
        },
      }
    ]
  },
  {
    path: '/statistic',
    component: Layout,
    redirect: 'noRedirect',
    meta: {
      auth: [0, 1],
      title: "统计数据管理"
    },
    children: [
      {
        path: 'empInfoStatistic',
        component: () => import("@/views/statisticManager/empInfoStatistic.vue"),
        meta: {
          auth: [0, 1],
          title: "员工信息管理"
        },
      }
    ]
  },
  {
    path: '/login',
    component: () => import("@/views/login")
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
